/**
 * 乘法
 * @param a string|null 被乘数
 * @param b string|null 乘数
 * @return string
 */
$.bcMul = function(a, b){
	function RE0(n){ return new Array(n+1).join('0'); }
	$.bcMul = function(a, b){
		let [_a,ia,da]=$.bcArr(a), [_b,ib,db]=$.bcArr(b);
		let A=ia+da, B=ib+db;  if(!A || !B) return '0';
		let rtn='0', _=_a!==_b, m=da.length+db.length;
		A=A.replace(/^0+/,'');  B=B.replace(/^0+/,'');
		if(A==='1') rtn=B; else if(B==='1') rtn=A;
		else{
			for(let i=0; i<A.length; i++){
				let x=A.charAt(i);  if(x==='0') continue;
				let n = A.length + B.length - 2 - i;
				for(let j=0,y; j<B.length; j++){
					if((y=B.charAt(j))==='0') continue;
					rtn=$.bcAddInt(rtn, (x*y)+RE0(n-j));
				}
			}
		}
		if(!m) return (_?'-':'')+rtn; let n=rtn.length,i,d;
		if(n===m) d=rtn; else if(n<m) d=RE0(m-n)+rtn;
		else{ i=rtn.slice(0,-m);  d=rtn.slice(-m); }
		d=d.replace(/0+$/,'');  if(d) d='.'+d;
		return (_&&(i||d)?'-':'')+(i||'0')+d;
	};
	return $.bcMul(a, b);
};
